package utils;

import com.google.common.primitives.Ints;

public enum RaidType {
	RAID0(0), RAID1(1), RAID3(3), RAID4(4), RAID5(5);
	
	private final int type;
	
	private RaidType(int i) {
		type = i;
	}
	
	public int getType() {
		return type;
	}
	public static RaidType parse(Integer i) {
		for(RaidType type : RaidType.values()) {
			if(type.getType() == i)
				return type;
		}
		return null;
	}
	public static RaidType parse(String str) {
		Integer tryParse = Ints.tryParse(str);
		for(RaidType type : RaidType.values()) {
			if(type.getType() == tryParse)
				return type;
		}
		return null;
	}
}
